package cn.kgc.springcloud.controller;

import cn.kgc.springcloud.client.Nacos01Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 课工场
 * @date 2023/10/17
 * @description
 */
@RestController
@RequestMapping("nacos02")
@RefreshScope
public class NacosClient02Controller {


    @Autowired
    private Nacos01Client nacos01Client;


    @Value("${age}")
    private Integer age;

    @RequestMapping("m1")
    public String method1(){

        String result = nacos01Client.method1();

        return "NacosClient02Controller >> NacosClient01Controller  >> result  >> " +result;
    }


    @RequestMapping("m2")
    public String method2(){

        return "NacosClient02Controller >> age = " +age;
    }
}
